package com.woniuxy.three.pms.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id ="2016093000633837";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCJHX8u8OI4VPjXlqXVRlF4ozrFIKbydhij3/AfLnpYceYSNqmWqXTV+Av7chMihz6/ORq62lTkgg3xxgul7Ayc7zx8WWT+SCT9DA9InXyc4Coeasbd/i1WAT8UydNUhhCTqdwRuiVBeFIWJcNuh/V0a0tX7s6Jy4TQK7z1/Hq+Arkks0j/QKmWqVtCWooq84B8Nz2sKIkqRyg9PPjMsoJgxalq1nt7OPjro3YEdekGrTgRHWCWQbUS1ZL3JKAfPIY14YT5G/tkrO1pV5OvvxqEG9pCyhaXIwgk4QpUpc4+j4565ChSJCY9ThmJY+IRHQTS5Sp33HqcYlhu/4+F7m5JAgMBAAECggEAGeWiUeFZOL6DyWRAqgl/9cMOpJDIN18qxDjVh24l2XKZu7LrUPNsh8UzrigbiRf2N/O3Ird99TLDI3j+VjZBI5rj17CirIw/wDN454QnNxH3oosUSHVrZqURnwGHkp1HoDwivo5j3vu0tU4onUW8jGJ/dno6NDhmO1Mne2ZWYHCobuleNbo3Ym8dXfGlTW6D9k0TIPPiW/Pebeu/4R0HcCNWIIlQnZicvn/Uvofdakam5svE1azUhaTXiOKeLxdwO61P/oHDAd/uwjocDDAO9Be19U5Mk/THKyQxLEIvu6r6Teoo3omAdWFr7dN0On/Mkw7sRDabNreNAQaUmvb7oQKBgQDAg97XgfGiKugBQdUrwvhZHeR9NhU1d9it0GOCBwJEBIAUKJtBFuGdCpuG9DpyoOCU2Aw2YTdjBloXBK0m7OxTsXSE4QYuBNCid8XD3+Sua+yX3KZddZxrzrIBD3nJ0gxsQWJ92tekn8aIe1lIIISGMdVn6OtMzouvCIxCN4EiHQKBgQC2VMQfcU3uN4tAgAY7eRFrhNpP/iQihNgSZloGyGZQs6hFeIMYKlLtCuuoHf5pKInPk4P/iAXZYYoPqZ8+Ql7FdaCBRtTJ3bX6EwPN8cTuTeb+9IITgWD84Ze4pJx8Qe8tIE5w/1Yfm0HM4eCy4hOSIpTsekiXoF0uqYJy378FHQKBgD+z4ytArmpQ9FBmLlm6vF8Qyyi7mq0EqUhqqmK+WvuS2abSAP26ypEij3BKpISFw4q9Kt1bse4sjecL/xfgUhsnnzzRETBtG3SHWYOFNLCaucFOnCZU4pux26kKK+yiesXfpO2sWqr4y8MhvdtmFzQojUtDAYl61zHmDDNlFm/pAoGAT8V8XQlUgDG68ghRMboBXhos7aySIKwgYMR5BNiuswY3S9Wy/WKfD2iku9QLl/SNfszahnT7oiTjo4Ch1Dpzfk69X3Ie7QbcdEHXe0YY0+4vb0KImoITbfBBUh5q/I5YV1T4HMYJ5yAlRL9acMkqqNgKcf/6PKSDwEOXeCzeRR0CgYAMouDK3LCv7jMvvDp9RJiHFY3aVkUslmySTy4MsNar+SyiiYvsHdq5ZKkYQbaM8Jd81G5GQr2QxdFvq8pl60D0NA8szIV30Iq11IAk4uEXGKfscaFlpY7XBJLe19iNjbSw/33Xa5Qk9fr+pLxbF5y85tPKfLvHWVNI9x1+KYqm8Q==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvq03V8XV/SycknC+SNia+17xBgkQPqWWlfutHXsXZyGvHyfbwcW7D5JtquwKKTu6ZZhZNZA2nKL0vgEKp9+Nhpbn02vTd2rTFjhT8saIEH2A+3ZIDhl1yRlO4+p9oUIjoXejIb7BW4Mi1SuYY/bHYQ/uDnhZ/bwYJDLP8HiOV0Q/sKkyKTEVWbMp+pDdzimBvn36K9QDLruUXAERHNLr5tMRePYIPoDFIc13wKlASNDVs4RZLj94W/XXEN96/QwfLCpFImxRse2Qxytn7JB6dXFdnkSEQ8270Gtswyq4xGR2/KA/qBT/BD7QN/usnHPV+4zkwnRuAyO3SsqmEAtv2wIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url ="http://2qt5433641.qicp.vip/order/save";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url ="http://2qt5433641.qicp.vip/front/html/index.html";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关https://openapi.alipaydev.com/gateway.do
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}


